package test.net;

import com.wan.net.config.HostAndPort;

import java.util.*;

/**
 * @author wwh
 * @date 2022/6/16 15:57
 */
public class Message {

    private String value;

    private Map<String,Integer> sMap;

    private int age;

    private List<Long> longList;

    private Date date;

    private HostAndPort hostAndPort;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Map<String, Integer> getsMap() {
        return sMap;
    }

    public void setsMap(Map<String, Integer> sMap) {
        this.sMap = sMap;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public List<Long> getLongList() {
        return longList;
    }

    public void setLongList(List<Long> longList) {
        this.longList = longList;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public HostAndPort getHostAndPort() {
        return hostAndPort;
    }

    public void setHostAndPort(HostAndPort hostAndPort) {
        this.hostAndPort = hostAndPort;
    }

    public static Message newMock(){
        Message message = new Message();
        message.setValue("传送过来");
        message.setAge(22);
        message.setHostAndPort(HostAndPort.of("179.141.31.1",5567));
        message.setDate(new Date());
        Map<String,Integer> map = new HashMap<>();
        map.put("第一",1);
        map.put("第二",2);
        map.put("第三",3);
        message.setsMap(map);
        List<Long> list = new ArrayList<>();
        for (long i = 0; i < 15; i++) {
            list.add(i);
        }
        message.setLongList(list);
        return message;
    }

    @Override
    public String toString() {
        return "Message{" +
                "value='" + value + '\'' +
                ", sMap=" + sMap +
                ", age=" + age +
                ", longList=" + longList +
                ", date=" + date +
                ", hostAndPort=" + hostAndPort +
                '}';
    }
}
